package com.iv.durian.cloud.facade
        ;

import com.iv.durian.cloud.Banner;
import com.iv.durian.cloud.Serve;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
@FeignClient(name = Serve.SERVICE_NAME)
@RequestMapping("/service/banner")
public interface BannerFacade {

    @RequestMapping(value = "/list/{type}/{status}", method = RequestMethod.GET)
    List<Banner> list(@PathVariable("type")Integer type,@PathVariable("status")Integer status);

    @RequestMapping(value = "/get/{bannerId}", method = RequestMethod.GET)
    Banner get(@PathVariable("bannerId") Integer bannerId);

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    void add(@RequestBody Banner banner);

    @RequestMapping(value = "/remove/{bannerId}", method = RequestMethod.GET)
    int remove(@PathVariable("bannerId")Integer bannerId);

    @RequestMapping(value = "/count/{type}/{status}", method = RequestMethod.GET)
    int count(@PathVariable("type")Integer type,@PathVariable("status")Integer status);

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    void update(@RequestBody Banner banner);
}
